// index.js
// 获取应用实例
const app = getApp()

Page({
  data: {
    userInfo:[],//用户信息
  },
  changPhone(e){
        wx.makePhoneCall({
          phoneNumber: '15507995485',
          success:function(){
            console.log("拨打电话成功");
          },
          fail:function(){
            console.log("拨打电话失败");
          }
        })
  },
  goPayment(e){
    console.log(e.currentTarget.dataset.name);
    //将收费项目名称存储至本地
    wx.setStorageSync('names', e.currentTarget.dataset.name)
    wx.navigateTo({
      url: '/pages/payment/payment',
    })
  },
  toRepair(){
    wx.navigateTo({
      url: '/pages/repair/repair',
    })
  },
  toAnnouncements(){
    wx.navigateTo({
      url: '/pages/announcements/announcements',
    })
  },
  toSuggest(){
    wx.navigateTo({
      url: '/pages/suggest/suggest',
    })
  },
  toActivity(){
    wx.switchTab({
      url: '../activity/activity',
    })
  },
  toAnnouncements(){
    wx.navigateTo({
      url: '../announcements/announcements',
    })
  },
  toUserBind(){
    wx.navigateTo({
      url: '../userBind/userBind',
    })
  },
  // 事件处理函数
  bindViewTap() {
   
  },
  onLoad() {
    let userInfo=wx.getStorageSync('userInfo');

    if(userInfo){
      userInfo =JSON.parse(userInfo);
       this.setData({
         userInfo:userInfo
       })
       console.log(this.data.userInfo);
     }
   
  },
  getUserProfile(e) {
    
  },
  getUserInfo(e) {
   
  }
})
